# -*- coding: utf-8 -*-
"""
@Project: base_python
@File: nltktest3.py
@Author: PC
@Date: 2025/06/13
@Description: 
"""
from nltk import ngrams
from nltk import FreqDist
from nltk.book import text6
fourgrams = ngrams(text6, 4)
fourgramsDist = FreqDist(fourgrams)
# print(fourgramsDist[('father', 'smelt', 'of', 'elderberries')])

for fourgram in fourgrams:
    if fourgram[0] == 'coconut':
        print(fourgram)